import { createRouter, createWebHistory } from "vue-router";

const routes = [
  {
    path: "/",
    component: () => import("../views/mainLayout/indexView.vue"),
    children: [
      {
        path: "/",
        component: () => import("../views/home/indexView.vue"),
      },
      {
        path: "/classify",
        component: () => import("../views/classify/indexView.vue"),
      },
      {
        path: "/cart",
        component: () => import("../views/cart/indexView.vue"),
      },
      {
        path: "/my",
        component: () => import("../views/my/indexView.vue"),
      },
    ],
  },
  {
    path: "/login",
    component: () => import("../views/login/indexView.vue"),
  },
  {
    path: "/search",
    component: () => import("../views/search/indexView.vue"),
  },{
    path: "/detail/:id",
    component: () => import("../views/detail/indexView.vue"),
  }
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
